Routing method for multiple security elements, NFC controller and NFC device

ABSTRACT

Disclosed are a routing method for multiple security elements (SEs), an NFC controller and an NFC device. The NFC device includes at least three SEs capable of working simultaneously; after receiving a request from an external device for accessing an NFC application, the NFC controller searches a routing table for an SE to be routed according to an AID carried in the request; and in a case where the SE is not found, the request is sent to all other SEs in the NFC device except the part of SEs.

CROSS-REFERENCE TO RELATED APPLICATION

The present application is based on and claims a priority from theChinese patent application No. 201711170809.9 filed on Nov. 22, 2017,the entire disclosure of which is incorporated herein by reference.

TECHNICAL FIELD

The present disclosure relates to Near Field Communication (NFC)technologies, and more particularly relates to a routing method formultiple security elements (SEs), an NFC controller and an NFC device.

BACKGROUND

Card emulation is one of the important functions of NFC devices such asNFC mobile phones, upon which various payment functions are relied. Forsecurity purpose, a payment system of an NFC mobile phone requires SEsas components thereof. The SEs provide secure storage for sensitiveinformation as well as a secure execution environment for transactions.NFC applications (APPs) reside on the SEs, and each NFC Application hasan Application ID (AID).

In the past, an NFC-supported mobile phone generally supports only onesecurity element, but later, Android began to support Host-based CardEmulation (HCE). Some mobile phones began to have embedded SEs (eSEs),and more and more mobile phones began to support a dual-functionUniverse Integrate Circuit Card (UICC), where both card slots support aSingle Wire Protocol (SWP), and the UICC may serve as SEs of the mobilephone. Such an NFC-supported mobile phone may have at least three SEs.

In the existing art, when at least three SEs in the NFC mobile phone arecapable of working simultaneously, routing through a routing table isrealized by writing AIDs of all the SEs into the routing table, and,after receiving a request from an external device for accessing an NFCapplication, searching the routing table according to the AID carried inthe request. This method can realize direct routing to all the SEs, butmay lead to insufficient space in the routing table.

SUMMARY

In view of above, in an embodiment of the present disclosure, there isprovided a routing method for multiple security elements. The routingmethod is applied to an NFC device having at least three SEs capable ofworking simultaneously, the and routing method includes:

receiving, by an NFC controller in the NFC device, a request from anexternal device for accessing an NFC application;

searching, by the NFC controller, a routing table for a security element(SE) to be routed according to an AID carried in the request, AID routesfor part of the SEs in the NFC device being stored in the routing table:

sending, by the NFC controller in a case where the SE is not found, therequest to all other SEs in the NFC device except the part of SEs.

In view of above, in an embodiment of the present disclosure, there isfurther provided an NFC controller, including:

an external interface module configured to receive a request carrying anAID from an external device for accessing an NFC application;

a routing table module configured to store AID routes for part of SEs inan NFC device, the NFC device having at least three SEs are capable ofworking simultaneously; and

a routing control module configured to search the routing table for anSE to be routed according to the AID carried in the request, and send,in a case where the SE is not found, the request to all other SEs in theNFC device except the part of SEs.

In view of above, in an embodiment of the present disclosure, there isfurther provided an NFC device, including at least three SEs capable ofworking simultaneously, and an NFC controller. The NFC controllerincludes a memory, a processor, and a computer program stored in thememory and executable by the processor, wherein the processor executesthe computer program to implement the steps of:

receiving a request from an external device for accessing an NFCapplication; and

searching a routing table for an SE to be routed according to an AIDcarried in the request, AID routes for part of the SEs in the NFC devicebeing stored in the routing table;

sending, in a case where the SE is not found, the request to all otherSEs in the NFC device except the part of SEs.

In view of this, in an embodiment of the present disclosure, there isfurther provided a computer readable storage medium having a computerprogram stored thereon which, when executed by a processor, causes themethod as described above to be implemented.

The solutions in the above embodiments can provide support for at leastthree SEs capable of working simultaneously, and make the NFC routingtable occupy less space.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of a portion of an NFC device related to acard emulation function according to Embodiment I of the presentdisclosure;

FIG. 2 is a flowchart of a routing method for multiple SEs according toEmbodiment I of the present disclosure;

FIG. 3 is a schematic diagram of modules related to a card emulationfunction according to Embodiment II of the present disclosure, showingthe routes initially stored in a routing table;

FIG. 4 is a schematic diagram of the routing table of FIG. 3 updatedafter a transaction according to Embodiment II of the disclosure; and

FIG. 5 is a block diagram of an NFC controller in an NFC deviceaccording to Embodiment III of the present disclosure.

DETAILED DESCRIPTION

For clarity and better understanding of the objects, technical solutionand advantages of the disclosure, embodiments of the disclosure will nowbe described in detail in conjunction with the accompanying drawings. Itshould be noted that the embodiments of the present application andfeatures therein may be combined with each other in any manner as longas they are not contradictory.

Embodiment I

This embodiment provides a routing method for multiple SEs, which isapplied to an NFC device having at least three SEs capable of workingsimultaneously.

The portion of the NFC device related to the card emulation functionincludes an NFC controller, SEs and an NFC antenna. As shown in FIG. 1,the NFC device of this embodiment includes three SEs, among which afirst SE 21 is host-based card emulation, i.e., an HCE, and the NFCcontroller 10 communicates with the HCE through a host operating system30, such as an Android system. The second SE 22 and the third SE 23 areUICC1 and UICC2, respectively. The three SEs in the NFC device can worksimultaneously. It should be noted that the above types and number ofSEs are only exemplary, and the number of SEs may be more than three.For example, an embedded SE, an SE on an SD card, or the like may alsobe included.

The host operating system 30 is a part that directly interacts with auser, including prompting the user and processing the user's selections,interacting with the NFC controller 10 and making corresponding settingsfor the NFC controller 10, and so on. The NFC controller 10 communicateswith an external device, such as a card reader, via an NFC antenna 40,and, after receiving a request from the external device for accessing anNFC application, interacts with the respective SEs 21-23 according torouting information in the routing table, and returns a response to theexternal device. The routing table may be integrated in the NFCcontroller 10.

The routing method for multiple SEs of this embodiment is as shown inFIG. 2, including the following steps 110 to 140.

At step 110, receiving, by an NFC controller, a request from an externaldevice for accessing an NFC application, the request carrying an AID ofthe NFC application to be accessed by the external device.

At step 120, searching, by the NFC controller, a routing table for a SEto be routed according to the AID carried in the request, proceeding tostep 130 in a case where the SE is found, and proceeding to step 140 ina case where the SE is not found.

Here, due to limited space of the routing table, only the AID routesfor/of part of the SEs in the NFC device are stored in the routingtable. In this embodiment, the routing table initially stores AID routesfor one SE; while in another embodiment, the routing table initiallystores AID routes for one SE, but the SE is not necessarily HCE, but anSE (among the SEs) with the smallest number of AIDs registered in theNFC device, which may ensure that the routing table occupies thesmallest space.

At step 130, sending, by the NFC controller, the request to the foundSE.

At step 140, sending, by the NFC controller, the request to all otherSEs in the NFC device except the part of SEs (i.e., to all SEs in thedevice other than the part of SEs).

In this embodiment, the NFC controller may send the request to all otherSEs except the part of SEs in two ways, one is to broadcast the requestto all the other SEs, and the other is to first send the request to oneof all the other SEs, and then, in a case where no positive response isreceived, send the request to a next one of all the other SEs, until apositive response is received or the request has been sent to each ofall the other SEs.

After the NFC controller sends the request to all the other SEs, each SEprocesses the request, and in a case where the request is not concernedby the SE (the AID carried in the request does not exist in the SE), theSE directly discards the request or return a negative response to theNFC controller, and in a case where the request is concerned by the SE,the SE returns a positive response to the NFC controller after theprocessing. There may be APPs with the same AID in different SEs, e.g.,two UICCs may be of the same operator and installed with the same APP.Then, the NFC controller will receive positive responses from bothUICCs.

In a case where the NFC controller receives a positive response returnedfrom only one SE, the NFC controller returns the positive response tothe external device; and in a case where the NFC controller receivesplural positive responses returned from plural SEs, the NFC controllerprompts, through a host operating system, a user to select one of theplural SEs, and returns the positive response returned from the SEselected by the user to the external device. After the user selects oneSE, the routing table may maintain unchanged, and when the NFC receivespositive responses returned from the plural SEs again, the NFCcontroller may further prompt, through the host operating system, theuser to select one of the plural SEs. In order to avoid the troublecaused by repeated prompting, the NFC controller may add the AID routefor the SE selected by the user to the routing table, and performnonvolatile storage (long-term storage) (to store the added AID route ina non-volatile manner). When the NFC device is restarted, the addedroute may be rewritten into the NFC routing table, and when a requestcarrying the AID is received again by the NFC controller, the requestmay be directly routed to the SE selected by the user by searching inthe routing table. To facilitate modification, the host operating systemmay provide a setting interface on which the SEs selectable by the usermay be manually cleared or modified. The host operating system notifiesthe NFC controller of a corresponding user operation, the NFC controllerperforms a corresponding update operation on the routing table, and theupdated content is also stored in a nonvolatile manner. Apparently,after the NFC device is powered on or triggered by other events, thehost operating system may also perform corresponding detection, and, ina case where multiple SEs having the same AID are detected, may promptthe user to select and accordingly update the routing table according tothe user's selection. In another example, only volatile storage, insteadof long-term storage, is performed for addition of the route, the addedroute does not exist in the routing table after the NFC device isrestarted, and when the NFC controller receives the request carrying theAID again, the user is still prompted to select.

In another example, after prompting the user to select one of the pluralSEs through the host operating system, the NFC controller records the SEselected by the user as a preferred SE (a flag indicating preference maybe added after the SE) among the plural SEs and performs nonvolatilestorage, and returns, when receiving positive responses returned fromthe plural SEs again after recording, the positive response returnedfrom the preferred SE to the external device. This processing modeavoids the trouble of repeated selections by the user, andsimultaneously eliminates the need of writing the routing table. In thiscase, the host operating system may further provide a setting interfaceon which the user may modify or clear the preferred SE manually. Thehost operating system notifies the NFC controller of a user operation,and the NFC controller performs a corresponding update operation on thepreferred SE and stores the updated content in a nonvolatile manner.After the NFC device is powered on, the host operating system mayperform active detection, and, when multiple SEs having the same AID aredetected, may prompt the user to select and record the preferred SE.

With the method of the embodiment, it is realized that several SEs of anNFC device with multiple SEs can be in working status simultaneously,and reasonable handling can be done when a conflict occurs, therebyimproving the user experience. Meanwhile, the method can effectivelysave space of the routing table, and AID routing information of SEs iswritten into the routing table only when necessary.

Embodiment II

This embodiment describes an example based on Embodiment I.

This example is applied to a mobile phone with an NFC function, wherethe modules related to the card emulation function are as shown in FIG.1, while referring to FIG. 3, each of the three SEs, HCE, UICC1 andUICC2, has two NFC applications therein. The routing table of the NFCcontroller initially stores AID routes for the HCE, and the AIDsregistered by the HCE are AID1 and AID2 which correspond to HCEapplications HCE_APP_1 and HCE_APP_2, respectively. Therefore, it isrecorded in the routing table that the SE corresponding to AID1 and AID2is HCE, indicating that requests carrying AID1, AID2 will be routed toHCE. The AID routes for other SEs are not written in the routing table.Among other SEs, UICC1 registers AID3 and AID4, respectivelycorresponding to applications UICC1_APP_3 and UICC1_APP_4 in UICC1.UICC2 registers AID5 and AID6, respectively corresponding toapplications UICC2_APP_5 and UICC2_APP_6 in UICC2, and both UICC1_APP_3and UICC2_APP_6 have an AID of AID3.

During a transaction process, an NFC card reader interacts with an NFCcontroller of an NFC mobile phone to select an AID and send a request(or request message) carrying the AID for accessing an NFC applicationto the NFC controller. The NFC controller inquires an SE to which therequest is to be or should be routed from the AID routing table:

In a case where the AID carried in the request is AID1 or AID2, theroute for the AID can be found in the routing table, so the NFCcontroller sends the request to the host operating system according tothe found route to be further processed by an HCE module in the hostoperating system. Then, the application HCE_APP_1 or HCE_APP_2 in theHCE responds to the request and returns a positive response to the NFCcontroller which in turn returns the positive response to the cardreader after receiving the positive response.

In a case where the AID carried in the request is one of AID3 to AID5,the NFC controller cannot find a route for the AID in the routing table,so the NFC controller broadcasts the request to all other SEs in the NFCdevice except the HCE, i.e., to UICC1 and UICC2. Among these, in a casewhere the request carries AID4, the UICC1_APP_4 in UICC1 will performprocessing and return a positive response, while no APP in UICC2responds to the request and the request is discarded. Then, the NFCcontroller returns the positive response returned from UICC1 to the cardreader.

In a case where the request carries AID5, no APP in UICC1 responds tothe request, while the UICC2_APP_5 in UICC2 will perform processing andreturn a positive response, and then the NFC controller returns thereceived positive response returned from UICC2 to the card reader.

In a case where the request carries AID3, both the UICC1_APP_3 in UICC1and the UICC2_APP_6 in UICC2 will perform processing and return apositive response. After detecting that two SEs, that is, UICC1 andUICC2, have returned positive responses, the NFC controller encapsulatesthe request (including identifiers of UICC1 and UICC2) and notifies thehost operating system that there is an AID conflict. The host operatingsystem prompts, via a user interface, the user to select one of UICC1and UICC2, and notifies the UICC (herein assumed to be UICC1) selectedby the user to the NFC controller. The NFC controller returns thepositive response returned from UICC1 that is selected by the user tothe card reader, updates the routing table, and writes AID3 and theidentifier of UICC1 into the routing table correspondingly (i.e., addsan AID3 route into the routing table).

The updated routing table is as shown in FIG. 4. After that, when thecard reader selects AID3 again to initiate an access request, the NFCcontroller directly hands the request to UICC1 for processing since theAID3 route has been stored in the routing table. The AID3 route added inthe routing table may be stored in a nonvolatile manner and is notinfluenced by power-off, or may be stored merely in a volatile manner,that is, temporarily stored.

With this method, it is realized that several SEs of a terminal devicewith multiple SEs can be in activated status simultaneously, i.e., canbe used simultaneously, and reasonable handling can be done when aconflict occurs, thereby improving the user experience. Meanwhile, themethod can effectively save space of the routing table, as AID routinginformation of SEs is written into the routing table only whennecessary.

Embodiment III

This embodiment provides an NFC controller, an NFC device and a storagemedium corresponding to the method of Embodiment I.

The NFC controller in the NFC device of the embodiment is as shown inFIG. 5, including:

an external interface module 1001 configured to receive a requestcarrying an AID from an external device for accessing an NFCapplication;

a routing table module 1003 configured to store Application ID (AID)routes for part of secure elements (SEs) in an NFC device, the NFCdevice including at least three SEs capable of working simultaneously;

a routing control module 1005 configured to search the routing table foran SE to be routed according to the AID carried in the request, andsend, in a case where the SE is found, the request to the found SE, andsend, in a case where the SE is not found, the request to all other SEsin the NFC device except the part of SEs.

In this embodiment, the routing table initially stores AID routes forone SE, the SE being Host-based Card Emulation (HCE), or an SE with thesmallest number of AIDs registered in the NFC device.

In this embodiment, after sending the request to all the other SEs, therouting control module 1005 is further configured to return a responseto an external device by:

returning, in a case where only one SE returns a positive response, thepositive response to the external device; and

prompting, through a host operating system and in a case where positiveresponses returned from plural SEs are received, a user to select one ofthe plural SEs, and returning the positive response returned from the SEselected by the user to the external device.

In this embodiment, after prompting, through the host operating system,the user to select one of the plural SEs, the routing control module1005 is further configured to:

add the AID route for the SE selected by the user into the routingtable, and perform volatile storage; or

add the AID route for the SE selected by the user into the routingtable, and perform nonvolatile storage; or

record the SE selected by the user as a preferred SE among the pluralSEs and perform nonvolatile storage, and return, when receiving positiveresponses returned from the plural SEs again after recording, thepositive response returned from the preferred SE to the external device.

Any processing performed by the NFC controller in the method ofEmbodiment I may be implemented by corresponding modules in thisembodiment, which is not described in detail herein.

The NFC device of this embodiment includes at least three securityelements (SEs) capable of working simultaneously, and an NFC controller.The NFC controller includes a memory, a processor, and a computerprogram stored in the memory and executable by the processor, whereinthe processor executes the computer program to implement the steps of:

receiving a request from an external device for accessing an NFCapplication; and

searching a routing table for an SE to be routed according to anApplication ID (AID) carried in the request, AID routes for part of theSEs in the NFC device being stored in the routing table:

sending, in a case where the SE is found, the request to the found SE;and

sending, in a case where the SE is not found, the request to all otherSEs in the NFC device except the part of SEs.

In this embodiment, the routing table initially stores AID routes forone SE, the SE being Host-based Card Emulation (HCE), or an SE with thesmallest number of AIDs registered in the NFC device.

In this embodiment, after sending the request to all the other SEs, theprocessor is further configured to execute the computer program toimplement the steps of:

returning, in a case where only one SE returns a positive response, thepositive response to the external device; and

prompting, through a host operating system and in a case where positiveresponses returned from plural SEs are received, a user to select one ofthe plural SEs, and returning the positive response returned from the SEselected by the user to the external device.

In this embodiment, after prompting, through the host operating system,the user to select one of the plural SEs, the processor is furtherconfigured to execute the computer program to implement the steps of:

adding the AID route for the SE selected by the user into the routingtable, and performing volatile storage; or

adding the AID route for the SE selected by the user into the routingtable, and performing nonvolatile storage; or

recording the SE selected by the user as a preferred SE among the pluralSEs and performing nonvolatile storage, and returning, when receivingpositive responses returned from the plural SEs again after recording,the positive response returned from the preferred SE to the externaldevice.

Any processing performed by the NFC controller in the method ofEmbodiment I may be implemented by the processor in this embodimentexecuting the computer program, which is not described in detail herein.

This embodiment further provides a computer readable storage mediumhaving a computer program stored thereon, wherein the computer program,when executed by a processor, causes the following processing to beimplemented:

receiving a request from an external device for accessing an NFCapplication; and

searching a routing table for a security element (SE) to be routedaccording to an Application ID carried in the request, AID routes forpart of the SEs in the NFC device being stored in the routing table:

sending, in a case where the SE is found, the request to the found SE;and

sending, in a case where the SE is not found, the request to all otherSEs in the NFC device except the part of SEs.

In this embodiment, the routing table initially stores AID routes forone SE, the SE being Host-based Card Emulation (HCE), or an SE with thesmallest number of AIDs registered in the NFC device.

In this embodiment, after sending the request to all the other SEs, thecomputer program executed by the processor further causes the followingprocessing to be implemented:

returning, in a case where only one SE returns a positive response, thepositive response to the external device; and

prompting, through a host operating system and in a case where positiveresponses returned from plural SEs are received, a user to select one ofthe plural SEs, and returning the positive response returned from the SEselected by the user to the external device.

In this embodiment, after prompting, through the host operating system,the user to select one of the plural SEs, the computer program executedby the processor further causes the following processing to beimplemented:

adding the AID route for the SE selected by the user into the routingtable, and performing volatile storage; or

adding the AID route for the SE selected by the user into the routingtable, and performing nonvolatile storage; or

recording the SE selected by the user as a preferred SE among the pluralSEs and performing nonvolatile storage, and returning, when receivingpositive responses returned from the plural SEs again after recording,the positive response returned from the preferred SE to the externaldevice.

Any processing performed by the NFC controller in the method ofEmbodiment I may be implemented when the computer program is executed bythe processor, which is not described in detail herein.

Those of ordinary skill in the art will appreciate that all or somesteps of the above described method, functional modules/units in thesystem and apparatus may be implemented as software, firmware, hardware,and suitable combinations thereof. In a hardware implementation, thedivision between the functional modules/units mentioned in the abovedescription does not necessarily correspond to the division of physicalcomponents; for example, one physical component may have multiplefunctions, or one function or step may be performed cooperatively byseveral physical components. Some or all physical components may beimplemented as software executed by a processor, such as a CPU, adigital signal processor or microprocessor, or implemented as hardware,or implemented as an integrated circuit, such as an application specificintegrated circuit. Such software may be distributed on a computerreadable medium which may include a computer storage medium (ornon-transitory medium) and communication medium (or transitory medium).As is well known to those of ordinary skill in the art, the termcomputer storage medium includes volatile and nonvolatile, removable andnon-removable medium implemented in any method or technology for storinginformation, such as computer readable instructions, data structures,program modules or other data. A computer storage medium includes, butis not limited to, RAM, ROM, EEPROM, flash memory or other memorytechnology, CD-ROM, digital versatile disc (DVD) or other optical discstorage, magnetic cartridge, magnetic tape, magnetic disk storage orother magnetic storage devices, or may be any other medium used forstoring the desired information and accessible by a computer. Moreover,it is well known to those ordinary skilled in the art that communicationmedium typically includes a computer readable instruction, a datastructure, a program module, or other data in a modulated data signal,such as a carrier wave or other transport mechanism, and may include anyinformation delivery medium.

What is claimed is:
 1. A routing method for multiple security elements(SEs), which is applied to a Near Field Communication (NFC) devicehaving at least three SEs, the routing method comprising: receiving, byan NFC controller in the NFC device, a request from an external devicefor accessing an NFC application; searching, by the NFC controller, arouting table for a security element (SE) to be routed according to anApplication ID (AID) carried in the request, AID routes for part of theSEs in the NFC device being stored in the routing table: sending, by theNFC controller in a case where the SE is not found, the request to allother SEs in the NFC device except the part of SEs; the routing tableinitially stores AID routes for one SE, said one SE being an SE with thesmallest number of AIDs registered in the NFC device.
 2. The routingmethod according to claim 1, wherein after the NFC controller sends therequest to all the other SEs, the method further comprises: prompting,through a host operating system and by the NFC controller in a casewhere positive responses returned from plural SEs are received, a userto select one of the plural SEs, and returning the positive responsereturned from the SE selected by the user to the external device.
 3. Therouting method according to claim 2, wherein after the NFC controllerprompts, through the host operating system, the user to select one ofthe plural SEs, the method further comprises: adding, by the NFCcontroller, the AID route for the SE selected by the user into therouting table, and performing volatile storage; or, adding, by the NFCcontroller, the AID route for the SE selected by the user into therouting table, and performing nonvolatile storage; or, recording, by theNFC controller, the SE selected by the user as a preferred SE among theplural SEs and performing nonvolatile storage, and returning, whenreceiving positive responses returned from the plural SEs again afterrecording, the positive response returned from the preferred SE to theexternal device.
 4. The routing method according to claim 1, whereinafter the NFC controller sends the request to all the other SEs, themethod further comprises: prompting, through a host operating system andby the NFC controller in a case where positive responses returned fromplural SEs are received, a user to select one of the plural SEs, andreturning the positive response returned from the SE selected by theuser to the external device.
 5. A non-transitory computer readablestorage medium having a computer program stored thereon, wherein thecomputer program, when executed by a processor, causes processingaccording to the method of claim 1 to be implemented.
 6. A Near FieldCommunication (NFC) controller, comprising: an external interface moduleconfigured to receive a request carrying an Application ID (AID) from anexternal device for accessing an NFC application; a routing table moduleconfigured to store AID routes for part of secure elements (SEs) in anNFC device, the NFC device having at least three SEs, the routing tableinitially stores AID routes for one SE, said one SE being an SE with thesmallest number of AIDs registered in the NFC device; a routing controlmodule configured to search the routing table for an SE to be routedaccording to the AID carried in the request, and send, in a case wherethe SE is not found, the request to all other SEs in the NFC deviceexcept the part of SEs.
 7. The NFC controller according to claim 6,wherein: after sending the request to all the other SEs, the routingcontrol module is further configured to return a response to an externaldevice by: prompting, through a host operating system and in a casewhere positive responses returned from plural SEs are received by theNFC controller, a user to select one of the plural SEs, and returningthe positive response returned from the SE selected by the user to theexternal device.
 8. The NFC controller according to claim 7, wherein:after prompting, through the host operating system, the user to selectone of the plural SEs, the routing control module is further configuredto: add the AID route for the SE selected by the user into the routingtable, and perform volatile storage; or, add the AID route for the SEselected by the user into the routing table, and perform nonvolatilestorage; or, record the SE selected by the user as a preferred SE amongthe plural SEs and perform nonvolatile storage, and return, whenreceiving positive responses returned from the plural SEs again afterrecording, the positive response returned from the preferred SE to theexternal device.
 9. An NFC device, comprising at least three securityelements (SEs), and an NFC controller, the NFC controller comprising amemory, a processor, and a computer program stored in the memory andexecutable by the processor, wherein the processor executes the computerprogram to implement the steps of: receiving a request from an externaldevice for accessing an NFC application; and searching a routing tablefor an SE to be routed according to an Application ID (AID) carried inthe request, AID routes for part of the SEs in the NFC device beingstored in the routing table, the routing table initially stores AIDroutes for one SE, said one SE being an SE with the smallest number ofAIDs registered in the NFC device; sending, in a case where the SE isnot found, the request to all other SEs in the NFC device except thepart of SEs.
 10. The NFC device according to claim 9, wherein: aftersending the request to all the other SEs, the processor is furtherconfigured to execute the computer program to implement the step of:prompting, through a host operating system and in a case where positiveresponses returned from plural SEs are received, a user to select one ofthe plural SEs, and returning the positive response returned from the SEselected by the user to the external device.
 11. The NFC deviceaccording to claim 10, wherein: after prompting the user, through thehost operating system, to select one of the plural SEs, the processor isfurther configured to execute the computer program to implement thesteps of: adding the AID route for the SE selected by the user into therouting table, and performing volatile storage; or adding the AID routefor the SE selected by the user into the routing table, and performingnonvolatile storage; or recording the SE selected by the user as apreferred SE among the plural SEs and performing nonvolatile storage,and returning, when receiving positive responses returned from theplural SEs again after recording, the positive response returned fromthe preferred SE to the external device.